<?php if (is_plugin_enabled('izap_videos')){ ?>
<div id="river_container2">
<div class="dash_pad">

<?php

        $videos = $vars['entities'];
        $total = 16;
        if(isset($vars['videosTOdisplay']))
        $total = $vars['videosTOdisplay'];
        echo "<h3>" .elgg_echo('videos'). "</h3>";
        echo '<div class="contentWrapper2">';
        ?>
        
        <script>
            function selectTab(selectedTab, displayDiv) {
                $('#ltab').removeClass('selected');
                $('#vtab').removeClass('selected');
                $('#ctab').removeClass('selected');

               $('#latest').hide('fast');
                $('#views').hide('fast');
                $('#com').hide('fast');

               $('#'+displayDiv).show('fast');
                $('#'+displayDiv).load('<?php echo $vars['url']; ?>mod/izap_videos/customindexVideos.php?type='+displayDiv+'&videosTOdisplay='+<?php echo $total;?>);
                $('#'+selectedTab).addClass('selected');
            }
        </script>
        
        <div id="elgg_horizontal_tabbed_nav">
            <ul>
                <li id="ltab" style="font-size:9px;"><a href="javascript: selectTab('ltab', 'latest');"><?php echo elgg_echo('river:latestvideos'); ?></a></li>
                <li id="vtab" style="font-size:9px;"><a href="javascript: selectTab('vtab', 'views');"><?php echo elgg_echo('river:topViewed'); ?></a></li>
                <li id="ctab" style="font-size:9px;"><a href="javascript: selectTab('ctab', 'com');"><?php echo elgg_echo('river:topCommented'); ?></a></li>
            </ul>
        </div>
        
        <?php
        echo '<div id="latest">';
            echo '<p align="center"><img src="'.$CONFIG->wwwroot .'mod/embed/images/loading.gif"></p>';
        echo '</div>';
        echo '<div id="views">';
            echo '<p align="center"><img src="'.$CONFIG->wwwroot .'mod/embed/images/loading.gif"></p>';
        echo '</div>';
        echo '<div id="com">';
            echo '<p align="center"><img src="'.$CONFIG->wwwroot .'mod/embed/images/loading.gif"></p>';
        echo '</div>';
        echo '</div>';
        ?>
        
        <script language="javascript">
            $(document).ready(function(){
               selectTab('ltab', 'latest');
				});
        </script>
        
</div></div>
<?php }?>